package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.JiajiaOrderSettleDetail;
import com.ruoyi.system.mapper.JiajiaOrderSettleDetailMapper;
import com.ruoyi.system.service.IJiajiaOrderSettleDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 社工订单结算明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-05-10
 */
@Service
public class JiajiaOrderSettleDetailServiceImpl implements IJiajiaOrderSettleDetailService
{
    @Autowired
    private JiajiaOrderSettleDetailMapper jiajiaOrderSettleDetailMapper;

    /**
     * 查询社工订单结算明细
     * 
     * @param id 社工订单结算明细主键
     * @return 社工订单结算明细
     */
    @Override
    public JiajiaOrderSettleDetail selectJiajiaOrderSettleDetailById(Long id)
    {
        return jiajiaOrderSettleDetailMapper.selectJiajiaOrderSettleDetailById(id);
    }

    /**
     * 查询社工订单结算明细列表
     * 
     * @param jiajiaOrderSettleDetail 社工订单结算明细
     * @return 社工订单结算明细
     */
    @Override
    public List<JiajiaOrderSettleDetail> selectJiajiaOrderSettleDetailList(JiajiaOrderSettleDetail jiajiaOrderSettleDetail)
    {
        return jiajiaOrderSettleDetailMapper.selectJiajiaOrderSettleDetailList(jiajiaOrderSettleDetail);
    }

    /**
     * 新增社工订单结算明细
     * 
     * @param jiajiaOrderSettleDetail 社工订单结算明细
     * @return 结果
     */
    @Override
    public int insertJiajiaOrderSettleDetail(JiajiaOrderSettleDetail jiajiaOrderSettleDetail)
    {
        jiajiaOrderSettleDetail.setCreateTime(DateUtils.getNowDate());
        return jiajiaOrderSettleDetailMapper.insertJiajiaOrderSettleDetail(jiajiaOrderSettleDetail);
    }

    /**
     * 修改社工订单结算明细
     * 
     * @param jiajiaOrderSettleDetail 社工订单结算明细
     * @return 结果
     */
    @Override
    public int updateJiajiaOrderSettleDetail(JiajiaOrderSettleDetail jiajiaOrderSettleDetail)
    {
        jiajiaOrderSettleDetail.setUpdateTime(DateUtils.getNowDate());
        return jiajiaOrderSettleDetailMapper.updateJiajiaOrderSettleDetail(jiajiaOrderSettleDetail);
    }

    /**
     * 批量删除社工订单结算明细
     * 
     * @param ids 需要删除的社工订单结算明细主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaOrderSettleDetailByIds(String ids)
    {
        return jiajiaOrderSettleDetailMapper.deleteJiajiaOrderSettleDetailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除社工订单结算明细信息
     * 
     * @param id 社工订单结算明细主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaOrderSettleDetailById(Long id)
    {
        return jiajiaOrderSettleDetailMapper.deleteJiajiaOrderSettleDetailById(id);
    }
}
